#include <iostream>
using std::cout;
using std::endl;

int gNum = 10;

int func1(){
    int num = 10;
    return num;
}

int func2(){
    return gNum;
}


int & func3(){
    return gNum;
}

int && func4(){
    return 10;
}

void test0(){
    /* &func1(); */
    /* &func2(); */
    &func3();
    //匿名的右值引用本身也是右值
    /* &func4(); */
    int && ref = func4();
    //有名字的右值引用本身是左值
    &ref;
}

int main(void){
    test0();
    return 0;
}
